<script lang="ts" setup>
import type { DrawerProps } from "element-plus"

defineProps({
  modelVale: {
    type: Boolean,
    default: false
  },
  direction: {
    type: String as PropType<DrawerProps["direction"]>,
    default: "rtl"
  },
  title: {
    type: String,
    default: ""
  }
})
const emit = defineEmits<{
  (e: "update:modelValue", value: boolean): void
}>()

const handleClose = () => {
  emit("update:modelValue", false)
}
</script>

<template>
  <el-drawer
    :direction="direction"
    :modal-value="modelVale"
    :title="title"
    @close="handleClose"
  >
    <slot />
  </el-drawer>
</template>

<style scoped></style>
